import request from '@/utils/ruizhiRequest'
// 查品种适用范围
export const RetrieveVarietyScopes = () => {
  return request({
    url: '/v1/admin/variety/scopes/',
    method: 'get',
  })
}
// 创建品种
export const CreateNewVariety = (data) => {
  return request({
    url: '/v1/admin/variety/create/',
    method: 'post',
    data,
  })
}
// 查询品种
export const RetrieveVariety = (code = null, scope = null, kw = null) => {
  return request({
    url: '/v1/admin/variety/retrieve/',
    method: 'get',
    params: { code, scope, kw },
  })
}
// 保存修改
export const UpdateVariety = (data) => {
  return request({
    url: '/v1/admin/variety/update/',
    method: 'put',
    data,
  })
}

// 创建用户
export const CreateNewUser = (data) => {
  return request({
    url: '/v1/admin/user/create/',
    method: 'post',
    data,
  })
}

// 查询用户
export const RetrieveUser = (kw, page = 1, page_size = 30) => {
  return request({
    url: '/v1/admin/user/retrieve/',
    method: 'get',
    params: { kw, page, page_size },
  })
}

// 修改用户信息
export const UpdateUser = (data) => {
  return request({
    url: '/v1/admin/user/update/',
    method: 'put',
    data,
  })
}
